//
//  UserDefaultHandler.m
//  KD
//
//  Created by Hubery on 16/1/25.
//  Copyright © 2016年 ifly. All rights reserved.
//

#import "UserDefaultHandler.h"


@implementation UserDefaultHandler

+(void)initUserDefault{

    [self saveUserDetault:@"" key:kUsers_Kind];
    [self saveUserDetault:@YES key:kNotFirstLogin];
    [self saveUserDetault:@"" key:kID];
    [self saveUserDetault:@"" key:kUsers_Organization];
    [self saveUserDetault:@"" key:kUsers_CellPhoneNum];
    [self saveUserDetault:@"" key:kUsers_PassWord];
    [self saveUserDetault:@"" key:kUsers_CorpName];
    [self saveUserDetault:@"" key:kUsers_IDCard];
    [self saveUserDetault:@"" key:kUsers_RegisterDate];
    [self saveUserDetault:@"" key:kUsers_IsDel];
    [self saveUserDetault:nil key:KNotificationArray];
    [self saveUserDetault:@"" key:kUsers_Guid];
    [self saveUserDetault:@"" key:kUsers_PersonName];
    [self saveUserDetault:@"" key:kUsers_CorpKind];
    [self saveUserDetault:@"" key:kUsers_AppID];
    [self saveUserDetault:@"" key:kUsers_AreaCode];
    [self saveUserDetault:@"" key:kUsers_TableName];
    [self saveUserDetault:@"" key:kUsers_PKCode];
    [self saveUserDetault:@"" key:kUsers_Alias];
    [self saveUserDetault:@"" key:kUsers_JobName];
    [self saveUserDetault:@"" key:kUsers_CorpKindName];
    [self saveUserDetault:@"" key:kUsers_AreaName];
    [self saveUserDetault:@"" key:kRemember];
    [self saveUserDetault:@"" key:kNormalIn];
    [self saveUserDetault:@"" key:kUsers_Alias];
    [self saveUserDetault:@"" key:kUsers_PassWord];
    [self saveUserDetault:@"" key:Users_IsPayVip];
    [self saveUserDetault:@"" key:kIsLoginJpush];
    [self saveUserDetault:@"" key:kIsRegisterJpush];
    [self saveUserDetault:@[] key:kPicPunishTypeData];
    [self runSave];
    HXLog(@"%@",NSHomeDirectory());
}

+(void)saveUserDetault:(id) object key:(NSString *)key{
    [[NSUserDefaults standardUserDefaults] setValue:object forKey:key];
}

+(id)getUserDetault:(NSString *)key {
    return [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:key]];
}

+(NSDictionary *)getUserDetaultDictionary:(NSString *)key{
    return [[NSUserDefaults standardUserDefaults] objectForKey:key];
}

+(NSMutableArray *)getUserDetaultArray:(NSString *)key{
    return [[NSUserDefaults standardUserDefaults] objectForKey:key];
}

+(NSDate *)getUserDetaultDate:(NSString *)key{
    return [[NSUserDefaults standardUserDefaults] objectForKey:key];
}

+(void)runSave{
    [[NSUserDefaults standardUserDefaults]synchronize];
}

@end
